package cn.kasa.basic.service;

import cn.kasa.basic.query.BasicQuery;
import cn.kasa.basic.utils.PageList;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface IBaseService<T> {


    /*
     * @Title: loadAll
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:55
     * @Parameters:
     * @Return
     */
    // 查询所有
    List<T> loadAll();

    Integer queryCount(BasicQuery basicQuery);

    /*
     * @Title: loadById
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:55
     * @Parameters:
     * @Return
     */
    // 根据Id查询
    T loadById(Long id);

    /*
     * @Title: remove
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:55
     * @Parameters:
     * @Return
     */
    // 根据Id删除
    void remove(Long id);

    /*
     * @Title: save
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:55
     * @Parameters:
     * @Return
     */
    // 新增
    void save(T t);

    /*
     * @Title: update
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:55
     * @Parameters:
     * @Return
     */
    // 根据Id修改
    void update(T t);

    /*
     * @Title: queryData
     * @Description: TODO
     * @Author: ZaneZ
     * @Version: 1.0
     * @Date:  2022/6/21 17:55
     * @Parameters:
     * @Return
     */
    // 分页+高级查询
    PageList<T> queryData(BasicQuery BasicQuery);

    void batchRemove(Long[] ids);

}
